<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //set集合使用不方便时，可以将其转化为数组
        let set=new Set(["twcd.com","houdunren_tw"]);
console.log(set);//对象
        console.log(Array.from(set));// ['twcd.com', 'houdunren_tw']
        console.log([...set]);

        //将数组转化为set集合？？
        let arr=["twcd.com","houdunren.com"];
        let new_set=new Set(arr);
        console.log(new_set);// {'twcd.com', 'houdunren.com'}

        //案例，返回set里面超过4的数字
        let set11=new Set("12345789");
     set11= new Set([...set11].filter(item => item>4));//数组再转化为set就行
        console.log(set11);// {'5', '7', '8', '9'}
    </script>
</body>
</html>